<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function fun1(a){
            setTimeout(function(){
                a();
            },2000);
        }
        function fun2(){
            alert("你好");
        }
        fun1(fun2);
        console.log("我是同步程序");
    </script>
</body>
</html>